package at.chl.genetic.function.math;

import at.chl.genetic.function.AbstractGeneticFunction;
import at.chl.genetic.function.IGeneticFunction;
import at.chl.genetic.function.math.node.FunctionNode;
import at.chl.genetic.function.math.request.MathFunctionRequest;
import at.chl.genetic.function.math.result.MathFunctionResult;
import at.chl.genetic.function.request.IGeneticFunctionRequest;
import at.chl.genetic.function.result.IGeneticFunctionResult;

public abstract class AbstractMathFunction extends AbstractGeneticFunction{

	
	
	public AbstractMathFunction(String name) {
		super(name);
	}

	public abstract MathFunctionResult doFunction(MathFunctionRequest request);
	
	@Override
	public IGeneticFunctionResult doFunction(IGeneticFunctionRequest request) {
		if(!(request instanceof MathFunctionRequest)){
			//TODO throw exception
		}
		return doFunction((MathFunctionRequest)request);
	}
	public abstract void setParentNode(FunctionNode parentNode) ;

	
}
